package com.water.camera.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.water.camera.fragment.MarkListFragment;
import com.water.camera.it.WaterMarkChangeListener;

public class MarkPagerAdapter extends FragmentPagerAdapter {

    String[] title = new String[]{"全部", "考勤打卡", "工程记录", "物业管理", "执勤检查", "现场拍照", "生活娱乐"};
    WaterMarkChangeListener listener;

    public MarkPagerAdapter(@NonNull FragmentManager fm, WaterMarkChangeListener listener) {
        super(fm);
        this.listener = listener;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        MarkListFragment f = new MarkListFragment();
        f.setIndex(position, listener);
        return f;
    }

    @Override
    public int getCount() {
        return title.length;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
